import request from '@/utils/request'

export function fetchList(query) {
    return request({
        url: '/preserve/api/preserveItemGroup/query/page',
        method: 'get',
        params: query
    })
}

//保存
export function saveInfo(query) {
    if (query.id) {
        return request({
            url: `/preserve/api/preserveItemGroup`,
            method: 'put',
            data: query
        })
    } else {
        return request({
            url: `/preserve/api/preserveItemGroup`,
            method: 'post',
            data: query
        })
    }

}
//详细信息
export function fetchDetailInfo(query) {
    return request({
        url: `/preserve/api/preserveItemGroup/query/${id}`,
        method: 'get',
    })
}
//导出
export function exportFile(params) {
    return request({
        url: '/device/api/device/exportExcel',
        method: 'get',
    })
}
//下载批量导入模板

export function downloadTemplete(query) {
    return request({
        url: '/check/api/check/item/group/download/template',
        method: 'get',
        params: query
    })
}

//删除台账
export function deleteDeviceInfo(id) {
    return request({
        url: `/preserve/api/preserveItemGroup/${id}`,
        method: 'delete',
        // data: [query] //批量删除
    })
}
//启用
export function startUserInfo(query) {
    return request({
        url: '/user/api/user/start/' + query,
        method: 'put',
        //data: query
    })
}
//停用
export function stopUserInfo(query) {
    return request({
        url: '/user/api/user/stop/' + query,
        method: 'put',
        //data: query
    })
}